#include<iostream>
template <typename T>
void ShowArray(T arr[],int n);//模板A
template <typename T>
void ShowArray(T *arr[],int n);//模板B
struct debts{
    char name[50];
    double amount;
};
int main()
{
    using namespace std;
    int things[6] = {13,31,103,301,310,130};
    struct debts mr_E[3] = 
    {
        {"Ima Wolfe",2400.0},
        {"Ura Foxe",1300.0},
        {"iby Stout",1800.0}
    };
    double *pd[3];
    for(int i=0;i<3;i++)
    {
        pd[i] = &mr_E[i].amount;
    }
    cout<<"Listing Mr.E's counts of things:\n"<<endl;
    ShowArray(things,6);//传入整形，模板A的T替换为int
    cout<<"Listing Mr.E's counts of things:\n"<<endl;
    ShowArray(pd,3);//pd数据类型为double，匹配* double同时和B也匹配
    return 0;
}
template<typename T>
void ShowArray(T arr[],int n)
{
    using namespace std;
    cout<<"template A\n";
    for(int i=0;i<n;i++)
    {
        cout<<arr[i]<<" ";
    }
    cout<<endl;
}
template <typename T>
void ShowArray(T *arr[],int n)
{
    using namespace std;
    cout<<"template B\n";
    for(int i=0;i<n;i++)
    {
        cout<<*arr[i]<<" ";
    }
    cout<<endl;
}

